using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("GroupTournaments")]
	[Serializable]
    public class GroupTournament : DBO<GroupTournament>
    {
		#region Fields
		
		private int? _IdGroupTournament;
		private string _GroupTournamentName;
		private bool? _IsActived;
		private int? _SortOrder;
		private string _Icon;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public GroupTournament()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdGroupTournament 
		/// </summary>
		/// <param name="IdGroupTournament">The IdGroupTournament</param>
		public GroupTournament(int? IdGroupTournament )
		{
			this.IdGroupTournament = IdGroupTournament;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdGroupTournament">Sets int? value for IdGroupTournament</param>
		/// <param name="GroupTournamentName">Sets string value for GroupTournamentName</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="SortOrder">Sets int? value for SortOrder</param>
		/// <param name="Icon">Sets string value for Icon</param>
		public GroupTournament(int? idGroupTournament, string groupTournamentName, bool? isActived, int? sortOrder, string icon)
		{
			this.IdGroupTournament = idGroupTournament;
			this.GroupTournamentName = groupTournamentName;
			this.IsActived = isActived;
			this.SortOrder = sortOrder;
			this.Icon = icon;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdGroupTournament
		/// </summary>
		[ColumnAttribute("IdGroupTournament", SqlDbType.Int , 4 , true, true, false)]
		public int? IdGroupTournament
		{
			set
			{
				this._IdGroupTournament = value;
			}
			get
			{
				return this._IdGroupTournament;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for GroupTournamentName
		/// </summary>
		[ColumnAttribute("GroupTournamentName", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string GroupTournamentName
		{
			set
			{
				this._GroupTournamentName = value;
			}
			get
			{
				return this._GroupTournamentName;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for SortOrder
		/// </summary>
		[ColumnAttribute("SortOrder", SqlDbType.Int , 4 , false, false, true)]
		public int? SortOrder
		{
			set
			{
				this._SortOrder = value;
			}
			get
			{
				return this._SortOrder;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Icon
		/// </summary>
		[ColumnAttribute("Icon", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Icon
		{
			set
			{
				this._Icon = value;
			}
			get
			{
				return this._Icon;
			}
		}
		
		
		/// <summary>
		/// Get a list TournamentGroupTournament of current GroupTournament object base on IdGroupTournament
		/// </summary>
		public List<TournamentGroupTournament> TournamentGroupTournamentListForIdGroupTournament
		{
			get
			{
				if (this.IdGroupTournament == null)
					return null;
				TournamentGroupTournament condition = new TournamentGroupTournament();
				condition.IdGroupTournament = this.IdGroupTournament;
				return TournamentGroupTournamentController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdGroupTournament]
            /// </summary>
            public string IdGroupTournament
            {
                get
                {
                    return "IdGroupTournament";
                }
            }
            /// <summary>
            /// Get the name of column [GroupTournamentName]
            /// </summary>
            public string GroupTournamentName
            {
                get
                {
                    return "GroupTournamentName";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [SortOrder]
            /// </summary>
            public string SortOrder
            {
                get
                {
                    return "SortOrder";
                }
            }
            /// <summary>
            /// Get the name of column [Icon]
            /// </summary>
            public string Icon
            {
                get
                {
                    return "Icon";
                }
            }
        }
        #endregion
    }
}
